﻿@model ZhongheCms.Models.GswViewTieba
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
   
        
}

<div class="row">
    <div class="col-xs-12 col-sm-12 widget-container-col">
      
            <div class="widget-box">
                <div class="widget-header">
                    <h5 class="widget-title">@ViewBag.f  @if (!string.IsNullOrEmpty(ViewBag.p))
                                                         {
                        <span>(@ViewBag.p)</span>
                                                         }</h5>

                    <div class="widget-toolbar">
                    </div>
                </div>

                <div class="widget-body">


                    <div class="widget-main">

                        <div class="form-group">
                            <table id="sample-table-1" class="table table-bordered table-hover">
                                <tbody>
                                    <tr>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">发布日期
                                        </td>
                                        <td>

                                            @Model.PubDate.ToShortDateString() <span>&nbsp;</span>@Model.PubTime

                                        </td>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">发布人
                                        </td>
                                        <td>

                                            @Model.MemberNickname

                                        </td>

                                    </tr>


                                    <tr>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">主题
                                        </td>
                                        <td colspan="3">

                                            @Model.Title

                                        </td>
                                      
                                    </tr>
                                      <tr>
                                        <td class="align-right" style="width: 15%; background: #f6f6f6">内容
                                        </td>
                                        <td colspan="3">

                                            @Html.Raw(Model.PubContent)

                                        </td>
                                      
                                    </tr>

                                   
                                  
                                        @if(Model.TiebaReplies.Count>0)
                                        {
                                              <tr>

                                            <td colspan="4">
                                                <table class="table table-bordered table-hover">
                                                    <thead>
                                                        <tr>
                                                            
                                                             <th>回复日期
                                                            </th>
                                                            
                                                            <th>会员姓名
                                                            </th>

                                                            <th>
                                                              回复内容 
                                                            </th>
                                                            <th>
                                                                删除
                                                            </th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        @foreach (var item in Model.TiebaReplies)
                                                        {
                                                          
                                                           
                                                            <tr>
                                                               
                                                                <td>
                                                                    @item.ReplyDate.ToShortDateString() <span>&nbsp;</span>@item.ReplyTime

                                                                </td>
                                                                
                                                                <td>
                                                                    @item.MemberNickname
                                                                </td>
                                                                <td>
                                                                    @item.ReplyContent
                                                                </td>
                                                                
                                                                 <td class="center">
                                  
                                        <a  class="confirm" href="/Tieba/ReplyDelete/@item.MasterId?rid=@item.Id&m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&keywords=@ViewBag.keywords"><span
                                                                                                                                                                                                                       class="btn btn-xs btn-danger no-border"><i class="fa fa-trash-o"></i></span></a>
                                   
                                       
                                    </td>
                                                                
                                                            </tr>
                                       
                                                        }
                                                    </tbody>
                                                </table>

                                            </td>
                                        </tr>
                                        }

                                    
                                   

                                </tbody>
                            </table>
                        </div>


                        @if (ViewBag.scode == "1")
                        {
                            <div class="hr hr-2 dotted"></div>
                            <div class="alert alert-success">
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="icon-remove"></i>
                                </button>

                                <strong>
                                    <i class="icon-ok"></i>
                                    提示信息
                                </strong>

                                信息保存成功!
																
                            </div>
                        }
                        @if (ViewBag.scode == "0")
                        {
                            <div class="hr hr-2 dotted"></div>
                            <div class="alert alert-danger">
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="icon-remove"></i>
                                </button>

                                <strong>
                                    <i class="icon-remove"></i>
                                    错误提示
                                </strong>

                                @Html.ValidationSummary(true)

                            </div>

                        }
                        <div class="clearfix form-actions">
                            <div class="col-md-offset-3 col-md-9">
                             
                                <button class="btn" type="button" onclick="funBack()">
                                    &nbsp;&nbsp;<i class="ace-icon fa fa-undo bigger-110"></i>
                                    返回&nbsp;&nbsp;
                                </button>
                            </div>
                        </div>




                    </div>



                </div>

            </div>
        

    </div>


</div>
@section js{
    <script src="/assets/js/jquery.validate.min.js"></script>
    <script src="/assets/js/jquery.validate.unobtrusive.js"></script>
    <script src="/assets/js/jquery.validate.unobtrusive.bootstrap.js"></script>
     <script src="/assets/js/bootbox.min.js"></script>
    <script type="text/javascript">
        jQuery(function ($) {
           
            bootbox.setDefaults({ locale: "zh_CN" });
            $(".confirm").on(ace.click_event, function (e) {
                e.preventDefault();
                var link = $(this).attr("href");
                bootbox.confirm("确认删除此记录吗?", function (result) {
                    if (result) {
                        document.location.href = link;
                    }
                });
            });

        });
         function funBack() {
             document.location = "/Tieba/Index/0?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&sdate=@ViewBag.sdate&edate=@ViewBag.edate&keywords=@ViewBag.keywords";
        }
    </script>
}
